﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace WindowsGame1
{
    class Player:AnimatedObject2D
    {
        //public float position;
        public Player(Texture2D player, Animation[] animations, Vector2 origin, Vector2 range, Vector2 pos):base (player, pos, animations)
        {

        }

        public override void Update(GameTime gameTime)
        {
            GamePadState gamePadState = GamePad.GetState(PlayerIndex.One);
            if (gamePadState.IsConnected) 
            {
                //if (gamePadState.DPad.Up == ButtonState.Pressed) { }
                //if (gamePadState.DPad.Down == ButtonState.Pressed) { }
                //if (gamePadState.DPad.Left == ButtonState.Pressed) { }
                //if (gamePadState.DPad.Right == ButtonState.Pressed) { }
                //if (gamePadState.Buttons.X == ButtonState.Pressed) { }
                //if (gamePadState.Buttons.B == ButtonState.Pressed) { }
                //if (gamePadState.Buttons.A == ButtonState.Pressed) { }
                //if (gamePadState.Buttons.RightShoulder == ButtonState.Pressed) { }
                //if (gamePadState.Buttons.LeftShoulder == ButtonState.Pressed) { }
            }
            if (!gamePadState.IsConnected)
            {
                if (Input.GetKey(Keys.Up))
                {
                    var pos = this.Position;
                    pos.Y--;
                }
                if (Input.GetKey(Keys.Down))
                {
                    var pos = this.Position;
                    pos.Y++;
                }
                if (Input.GetKey(Keys.Right))
                {
                    var pos = this.Position;
                    pos.X++;
                }
                if (Input.GetKey(Keys.Left))
                {
                    var pos = this.Position;
                    pos.X--;
                }
                if (Input.GetKey(Keys.C)) { }
                if (Input.GetKey(Keys.X)) { }
                if (Input.GetKey(Keys.Z)) { }
                if (Input.GetKey(Keys.NumPad1)) { }
                if (Input.GetKey(Keys.NumPad2)) { }
                if (Input.GetKey(Keys.NumPad3)) { }
                base.Update(gameTime);
            }
        }

        //public override void Load(ContentManager content, Vector2 window)
        //{
            
        
        //}
    }
}
